﻿CREATE TABLE [dbo].[Segment]
(
	Id int NOT NULL CONSTRAINT PK_Segment PRIMARY KEY IDENTITY(1,1), 
	Departure char(3) NOT NULL CONSTRAINT FK_Segment_Airport_Departure REFERENCES Airport(Code),
	Destination char(3) NOT NULL CONSTRAINT FK_Segment_Airport_Destination REFERENCES Airport(Code),
	Distance int NOT NULL CONSTRAINT CK_SegmentDistance CHECK(Distance > 0),
	Description nvarchar(200)
)